#pragma once
#include <mzfc_inc.h>
#include <ddraw.h>

#define BUTTON_WIDTH	150
#define BUTTON_HEIGHT	50

class CMyButton
{
public:
	CMyButton(void);
	virtual ~CMyButton(void);
public:
	bool CreateButton(LPDIRECTDRAW pDD);
	void SetPosition(int x, int y);
	void SetText(LPCTSTR lpszText);
	void SetCommand(UINT commandId) { m_CommandId = commandId; }
	UINT CommandId() const { return m_CommandId; }
	void Paint(LPDIRECTDRAWSURFACE pBackBuffer);
	BOOL HitTest(int xPos, int yPos);
	bool Down() const { return m_bDown; }
	void Down(bool val);

protected:
	void Init();

	LPDIRECTDRAWSURFACE m_pDDSButton;
#ifdef _I8_MID_SDK_
	CRect	m_rButton;
#else
	CMzRect m_rButton;
#endif
	CMzString m_sText;
	UINT m_CommandId;
	bool m_bDown;

};
